package ${package};

import org.springframework.beans.factory.annotation.Autowired;

import com.eastchina.fids2focs.domain.${model.javaClass};
import com.eastchina.fids2focs.dao.${model.javaClass}DAO;
import com.eastchina.fw.database.dao.QueryDAOHelper;
import com.eastchina.fw.database.dao.UpdateDAOHelper;

public class ${model.javaClass}DAOImpl implements ${model.javaClass}DAO {
	
	@Autowired
	QueryDAOHelper queryDAOHelper;
	
	@Autowired
	UpdateDAOHelper updateDAOHelper;	

	public ${model.javaClass} selectByPrimaryKey(${model.javaClass} obj) {
		return queryDAOHelper.executeForObject("${model.tableName}.selectByPrimaryKey", obj, ${model.javaClass}.class);
	}
	
	public void insert(${model.javaClass} obj) {
		updateDAOHelper.execute("${model.tableName}.insert", obj);
	}
	
	public void updateByPrimaryKey(${model.javaClass} obj) {
		updateDAOHelper.execute("${model.tableName}.updateByPrimaryKey", obj);
	}

	public void deleteByPrimaryKey(${model.javaClass} obj) {
		updateDAOHelper.execute("${model.tableName}.deleteByPrimaryKey", obj);
	}
}
